#Logfile.py |
#-----------
#Logs moves for the last game in a text file for human readability

import tempfile
import os
from Grid import *

class Log(Grid):

    def __init__(self):

        Grid.__init__(self)

        self.file=open('game.log', 'w')




    def Record(self, y, x):

        self.file.write('%s,%s\n' % (y, x))



    def Save(self, Raised):

        self.file.write('Human=%s\n' % (self.Human))
        self.file.write('Exception Raised=%s' % (Raised))

        self.file.close()

        print 'Log file saved in %s' % (os.getcwd())



    def Move(self, Person, y, x):

        self.Record(y, x)

        Grid.Move(self, Person, y, x)

        
